﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Xant.FlowEngine.Core
{
    /// <summary>
    /// 邮件发送活动
    /// </summary>
    public sealed class EmailActivity : AutoActivity
    {
        #region 属性
        /// <summary>
        /// 收件人(多个收件人用;号分隔)
        /// </summary>
        public string Recipients { get; set; }

        /// <summary>
        /// 邮件主题
        /// </summary>
        public string Subject { get; set; }

        /// <summary>
        /// 邮件内容
        /// </summary>
        public string Content { get; set; }
        #endregion

        #region 构造函数
        public EmailActivity(): base()
        {
        }

        public EmailActivity(string code): base(code, null)
        {
        }

        public EmailActivity(string code, string name): base(code, name)
        {
        }

        #endregion

        #region 实现抽象方法
        protected override AbstractActivity Clone()
        {
            var clone = new EmailActivity();
            //to do:将本类声明的字段、属性作克隆处理，父类声明的由父类处理
            return clone;
        }

        #endregion

        #region 公有方法
        public override void Entry()
        {
            base.Entry();
            //发送邮件处理逻辑
            Leave();
        }

        #endregion

    }
}
